package com.sqtracker.recommender.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
@Document(collection = "recommendation_logs")
public class RecommendationLog {
    @Id
    private String id;
    private String userId;
    private List<Map<String, Object>> recommendations;
    private RecommendationContext context;
    private RecommendationFeedback feedback;

    public RecommendationLog() {
        this.context = new RecommendationContext();
        this.feedback = new RecommendationFeedback();
    }

    @Data
    public static class RecommendationContext {
        private String page;            // 推荐展示页面
        private Date timestamp;         // 推荐生成时间
        private String sessionId;       // 会话ID
    }

    @Data
    public static class RecommendationFeedback {
        private List<String> clicked;   // 用户点击的torrentId
        private List<String> ignored;   // 用户忽略的torrentId
        private Date timestamp;         // 反馈时间
    }
}